<#import "/common/taglibs/spring.ftl" as spring/>
<#macro sidebarMenu menus top=true group="">
    <#if top!=true>
        <ul class="sub-menu">
    </#if>
    <#list menus as menu>
            <#if menu.children?? && (menu.children?size gt 0)>
                <li class="nav-item" data-menu-group="${group}">
                    <a href="javascript:;" target="_blank" class="nav-link nav-toggle" id="menu_${(menu.code)!}" >
                        <i class="${(menu.icon)!}"></i> 
                        <span class="title"><@showName item=menu/></span>
                        <span class="arrow"></span>
                    </a>
                <@sidebarMenu menus=menu.children top=false group=group/>
                </li>
            <#else>
                <li class="nav-item" data-menu-group="${group}">
                    <a href="<@menuUrl url=(menu.url)!/>" class="nav-link" id="menu_${(menu.code)!}" data-menu-code="${(menu.code)!}" data-pjax>
                        <i class="${(menu.icon)!}"></i> <@showName item=menu/></a>
                </li>
            </#if>
    </#list>
    <#if top!=true>
        </ul>
    </#if>
</#macro>